<script>
    var pnum = {$pnum};
    var search = 0;
    var goUrl = "/{$Request.module}/nav_menu/navlist/nav_id/"+nav_id+".html?page="+pnum;

    $(function(){
        $("#checkAll").click(function () {
            $("input[class='text_id']:checkbox").prop("checked", this.checked);
        }); 
    });
</script>                          
                        
<table class="table table-hover table-bordered">
    <thead>
        <tr>
            <th style="width:5%"><input type="checkbox" id="checkAll"/></th>
            <th style="width:15%">菜单名称</th>
            <th style="width:10%">icon配图</th>
            <th style="width:20%">url地址</th>
<!--            <th style="width:10%">url类型</th>-->
            <th style="width:10%">是否显示</th>
            <th style="width:10%">排序</th>
            <th style="width:15%">操作</th>
        </tr>
    </thead>
    <tbody>
    {if condition="$list->isEmpty() == false"}
        {foreach name="list" item="v"}
        <tr>
            <td><input type="checkbox" class="text_id" name="id[]" value="{$v.id}" /></td>
            <td>{$v.menu_name}</td>
            <td><img src="{$v.image_path}" width="100px" height="100px" onerror="this.src='__PUBLIC__/admin/img/nopic.jpg'"></td>
            <td>{$v.menu_url}</td>
<!--            <td>{if($v.url_type == 1)}App内部跳转{elseif($v.url_type == 2)}H5跳转{elseif($v.url_type == 3)}小程序跳转{/if}</td>-->
            <td>
            {switch name="v.is_show"}
            {case value="0"}
            <button class="btn btn-danger btn-xs" type="button" onclick="changeTableVal({$v.id},'is_show',this);"><i class="fa fa-times"></i></button>
            {/case}
            {case value="1"}
            <button class="btn btn-primary btn-xs" type="button" onclick="changeTableVal({$v.id},'is_show',this);"><i class="fa fa-check"></i></button>
            {/case}
            {/switch}
            </td>
            <td><input name="{$v.id}" type="text" value="{$v.sort}" class="sort" size="3"></td>
            <td>
                <a href="{:url('NavMenu/edit',array('id'=>$v['id'],'nav_id' => $nav_id))}" class="btn btn-primary btn-xs">
                    <i class="fa fa-pencil"></i>&nbsp;编辑
                </a>
                <button type="button" class="btn btn-danger btn-xs" onclick="delone({$v.id},this);">
                    <i class="fa fa-close"></i>&nbsp;删除
                </button>
            </td>
        </tr>
        {/foreach}
        {else/}
        <tr><td colspan="8" style="text-align:center; font-size:14px;">没有找到相关数据</td></tr>
        {/if}							
    </tbody>
</table>
<div class="row"><div class="pagination" style="float:right; margin-right:20px;">{$page}</div></div>